#include "comm.hpp"

int main()
{
    //打开文件
    int fd = open(FIFO_FILE, O_WRONLY);
    if(fd < 0)
    {
        perror("open");
        exit(FIFO_OPEN_ERR);
    }

    std::cout << "client open file done" << std::endl;

    //发送数据
    while(1)
    {
        std::string link;
        std::cout << "Please Enter@ ";
        getline(std::cin, link);
        write(fd, link.c_str(), link.size());
    }

    close(fd);

    return 0;
}